package com.aaa.order.feign;

import com.aaa.entity.Product;
import com.aaa.order.factory.ProductFeignFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @program: qy156-shop-parent
 * @description:
 * @author: 闫克起
 * @create: 2022-11-19 15:12
 **/
//value:调用远程微服务的名称    fallbackFactory:降级类工厂
@FeignClient(value = "shop-product",fallbackFactory = ProductFeignFactory.class)
public interface ProductFeign {
    @GetMapping("/product/getById/{pid}")  //http://shop-product/product/getById/2
    public Product getById(@PathVariable Long pid);
}
